package pers.gxm.security.hello.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import pers.gxm.security.hello.common.R;
import pers.gxm.security.hello.pojo.User;
import pers.gxm.security.hello.service.LoginService;

@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/user/login")
    public R login(@RequestBody User user){
        System.out.println("进入登录接口");
        return loginService.login(user);
    }

    @GetMapping("/user/logout")
    public R logout(){
       return loginService.logout();
    }

}
